const express = require('express');
const cors = require('cors');
const bookRoutes = require('./routes/bookRoutes');
const dealerRoutes = require('./routes/dealerRoutes');
const goodsRoutes = require('./routes/goodsRoutes');
const purchaseOrderRoutes = require('./routes/purchaseOrderRoutes');

const app = express();

app.use(cors());
app.use(express.json());

// 路由
app.use('/books', bookRoutes);
app.use('/dealers', dealerRoutes);
app.use('/goods', goodsRoutes);
app.use('/purchase-orders', purchaseOrderRoutes);

const port = 3000;
app.listen(port, () => {
  console.log(`Server running on port ${port}`);
}); 